#!/usr/bin/env python


import sys

import string, random, os
import unittest

import pycaptcha


class TestPyCaptcha(unittest.TestCase):

    def setUp(self):
        pass

    def test_basic(self):
    c = pycaptcha.Captcha(250, 70)
    font = '/usr/share/fonts/truetype/arphic/bkai00mp.ttf'
    random.seed()
    text = ''.join(string.ascii_letters[random.randint(0, 26 * 2 - 1)] for x in\
            xrange(5))
    c.write_text(text, font, min_size=20, max_size=22, spacing=11, x=50,\
            y=50, blur = False)
    f = open('1111.jpeg', 'wb')
    for a in c:
        print a
    f.write(c)
    f.close()


if __name__ == '__main__':
    pass
